package com.android.lovingpet.common.teaminfo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.android.lovingpet.R;
import com.android.lovingpet.base.BaseActivity;
import com.android.lovingpet.base.BasePresenter;
import com.android.lovingpet.base.BaseView;
import com.android.lovingpet.bean.Team;
import com.bumptech.glide.Glide;

import butterknife.BindView;
import butterknife.ButterKnife;

public class TeamInfoActivity extends BaseActivity {

    @BindView(R.id.iv_head)
    ImageView ivHead;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_nature)
    TextView tvNature;
    @BindView(R.id.tv_phone)
    TextView tvPhone;
    @BindView(R.id.tv_email)
    TextView tvEmail;
    @BindView(R.id.tv_eTime)
    TextView tvTime;
    @BindView(R.id.tv_address)
    TextView tvAddress;
    @BindView(R.id.tv_introduction)
    TextView tvIntroduction;
    @BindView(R.id.tv_code)
    TextView tvCode;
    @BindView(R.id.ll_code)
    LinearLayout llCode;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_team_info);
        Team team = getIntent().getParcelableExtra("team");
        ButterKnife.bind(this);
        ((TextView) findViewById(R.id.tv_title)).setText("详情");
        Glide.with(this).load(team.getImage()).into(ivHead);
        tvName.setText(team.getName());
        tvNature.setText(team.getNature());
        tvPhone.setText(team.getoPhone());
        tvEmail.setText(team.getEmail());
        tvTime.setText(team.getEtime());
        tvAddress.setText(team.getAddress());
        tvIntroduction.setText(team.getIntroduction());
        if (TextUtils.isEmpty(team.getCodeNumber()))
            llCode.setVisibility(View.GONE);
        else
            tvCode.setText(team.getCodeNumber());
    }

    @Override
    public BasePresenter createPresenter() {
        return null;
    }

    @Override
    public BaseView createView() {
        return this;
    }
}
